package com.commutersconnect;

import android.os.Bundle;
import android.app.Activity;
import android.hardware.Camera;
import android.view.SurfaceView;

/**
 * Our activity for generating a new report is designed such that the user can
 * snap a picture and upload it with as little fuss as possible.
 *
 * As such, the layout is fairly straight forward with a menu item for sending
 * the report off.
 */
public class NewReport extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_report);

        try {
          Camera camera = Camera.open(0);
          SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_surface);
          camera.setPreviewDisplay(surfaceView.getHolder());
          camera.startPreview();
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
    }

}
